package com.duowan.realtime.model;


import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * @version 1.0
 * @author: tangsicheng
 * @date: 14-8-15
 * @since 1.0
 */
public class KpiResult {
    private String mtime;
    private String kpiCode;
    private int kpiValue;
    private String game;
    private String gameServer;
    private String product;
    private String iver;
    private String eventid;
    private String targetTable;

    private KpiResult() {
    }

    private KpiResult(KpiResultBuilder kpiResultBuilder) {
        this.mtime = kpiResultBuilder.mtime;
        this.kpiCode = kpiResultBuilder.kpiCode;
        this.kpiValue = kpiResultBuilder.kpiValue;
        this.targetTable = kpiResultBuilder.targetTable;
        this.game = kpiResultBuilder.game;
        this.gameServer = kpiResultBuilder.gameServer;
        this.product = kpiResultBuilder.product;
        this.iver = kpiResultBuilder.iver;
        this.eventid = kpiResultBuilder.eventid;
    }

    public String getMtime() {
        return mtime;
    }

    public void setMtime(String mtime) {
        this.mtime = mtime;
    }

    public String getKpiCode() {
        return kpiCode;
    }

    public void setKpiCode(String kpiCode) {
        this.kpiCode = kpiCode;
    }

    public int getKpiValue() {
        return kpiValue;
    }

    public void setKpiValue(int kpiValue) {
        this.kpiValue = kpiValue;
    }

    public String getGame() {
        return game;
    }

    public void setGame(String game) {
        this.game = game;
    }

    public String getGameServer() {
        return gameServer;
    }

    public void setGameServer(String gameServer) {
        this.gameServer = gameServer;
    }

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public String getIver() {
        return iver;
    }

    public void setIver(String iver) {
        this.iver = iver;
    }

    public String getEventid() {
        return eventid;
    }

    public void setEventid(String eventid) {
        this.eventid = eventid;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

    public String getTargetTable() {
        return targetTable;
    }

    public void setTargetTable(String targetTable) {
        this.targetTable = targetTable;
    }

    public static class KpiResultBuilder {
        //required fields
        private String mtime;
        private String kpiCode;
        private int kpiValue;
        private String targetTable;
        //optional fields
        private String game;
        private String gameServer;
        private String product;
        private String iver;
        private String eventid;

        public KpiResultBuilder(String mtime, String kpiCode, int kpiValue, String targetTable) {
            this.mtime = mtime;
           this.kpiCode = kpiCode;
            this.kpiValue = kpiValue;
            this.targetTable = targetTable;
        }

        public KpiResultBuilder game(String game) {
            this.game = game;
            return this;
        }

        public KpiResultBuilder gameServer(String gameServer) {
            this.gameServer = gameServer;
            return this;
        }

        public KpiResultBuilder product(String product) {
            this.product = product;
            return this;
        }

        public KpiResultBuilder iver(String iver) {
            this.iver = iver;
            return this;
        }

        public KpiResultBuilder eventid(String eventid) {
            this.eventid = eventid;
            return this;
        }

        public KpiResult build(){return new KpiResult(this);}

    }

}

